<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		<style>
			h5 {
				margin: 5px 7px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">审核日志</h1>

		</header>
		<div class="mui-content">
			<div class="mui-content-padded" style="margin: 5px;">
				<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
					<div class="mui-input-group">

						<div class="mui-table-view">
							<div class="mui-scroll" id="log">
								<ul class="mui-table-view">
									<li class="mui-table-view-cell" v-for="item in logs">
										<p>审核人：{{item.realname}}</p>
										<p>操作：{{item.content}}</p>
										<p>添加时间：{{item.addDate}}</p>
										<p>审核时间：{{item.auditDate}}</p>
									</li>
									<ul class="mui-table-view mui-table-view-chevron">
									</ul>
								</ul>
							</div>
						</div>

					</div>
				</div>
			</div>

		</div>

		<script type="text/javascript" src="js/mui.min.js "></script>
		<script type="text/javascript" src="js/jquery.min.js "></script>
		<script type="text/javascript" src="js/mui.view.js "></script>
		<script type="text/javascript" src="js/vue.min.js "></script>
		<script type="text/javascript" src="js/config.js "></script>
		<script type="text/javascript">
			var nowPage = 0;
			var datareq = new Array();
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					up: { //上拉加载
						auto: false,
						contentrefresh: '正在加载...',
						contentnomore: '没有更多数据了',
						callback: logulfun
					}
				}
			});
			mui.plusReady(function() {
				logulfun();
			});

			var logvm = new Vue({
				el: '#log',
				data: {
					logs: [],
				},
				methods: {}
			});
			
			function reload(){
				logulfun();
			}

			function logulfun() {

				$.get(dataDomain + "/dc/audit_comments/getLog?nowPage=" + nowPage, function(req) {
					if(req.length > 0) {
						datareq = datareq.concat(req);

						logvm.logs = datareq;
						nowPage++;
						if(req.length == 10) {
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
						} else {

							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
						}

					} else if(req.lenth == 0 && logvm.logs.length == 0) {
						logvm.logs = [];
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
					} else {
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
					}
				});
			}
		</script>
	</body>

</html>